package com.cloud.server.from.login;

public enum LoginType {
    /**
     * 手机号密码登陆
     * */
    MOBILE_PASSWORD("MOBILE_PASSWORD","mobilePassService"),
    /**
     * 手机验证码登陆
     * */
    MOBILE_CODE("MOBILE_CODE","mobileCodeService"),
    /**
     * 微信公众号登陆
     * */
    WX_PUBLIC("WX_PUBLIC","微信模板消息推送");


    private String code;
    private String desc;

    LoginType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static LoginType toEnum(String code) {
        for (LoginType category : LoginType.values()) {
            if (category.getCode().equals(code)) {
                return category;
            }
        }
        return null;
    }



    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
